﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using Model.ModelClasses;
using Data;
namespace View.Students
{
    /// <summary>
    /// Логика взаимодействия для AddNewStudentPanel.xaml
    /// </summary>
    public partial class AddNewStudentPanel : Window
    {
        public AddNewStudentPanel()
        {
            InitializeComponent();
        }

        private void AddNewStudentButtonClick(object sender, RoutedEventArgs e)
        {
            Student newStudent = new Student();
            newStudent.FamilyName = lastname.Text;
            newStudent.FatherName = patronymic.Text;
            newStudent.FullName = name.Text;
            newStudent.Birthday = date.DisplayDate;



            DataDispatcher.GetInstance().WriteNewStudentInfo(newStudent); 
        }

        private void Window_Closed(object sender, EventArgs e)
        {
            this.Close();

        }
    }
}
